<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<%@taglib prefix="rapid" uri="http://www.rapid-framework.org.cn/rapid" %>
<rapid:override name="frame-header-style">
    <link rel="stylesheet" href="resources/kindeditor/themes/default/default.css" />
    <link rel="stylesheet" href="resources/kindeditor/plugins/code/prettify.css" />
</rapid:override>
<rapid:override name="frame-header-script">
    <script charset="utf-8" src="resources/kindeditor/kindeditor-all-min.js"></script>
    <script charset="utf-8" src="resources/kindeditor/lang/zh-CN.js"></script>
    <script charset="utf-8" src="resources/kindeditor/plugins/code/prettify.js"></script>
</rapid:override>

<rapid:override name="frame-content">
    <blockquote class="layui-elem-quote">
        <span class="layui-breadcrumb" lay-separator="/">
              <a href="/admin">首页</a>
              <a href="notice">公告列表</a>
              <a><cite>编辑公告</cite></a>
        </span>
    </blockquote>

    <form class="layui-form"  method="post" id="myForm" action="notice/updateNotice">
        <input type="hidden" name="noticeId" value="${notice.noticeId}">
        <div class="layui-form-item">
            <label class="layui-form-label">标题  <span style="color: #FF5722; ">*</span></label>
            <div class="layui-input-block">
                <input type="text" name="noticeTitle" value="${notice.noticeTitle}" lay-verify="title" id="title" class="layui-input" required>
            </div>
        </div>

        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">内容  <span style="color: #FF5722; ">*</span></label>
            <div class="layui-input-block">
                <textarea class="layui-textarea layui-hide" name="noticeContent" lay-verify="content" id="content">${notice.noticeContent}</textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">Order <span style="color: #FF5722; ">*</span></label>
            <div class="layui-input-block">
                <input type="number" name="noticeOrder" value="${notice.noticeOrder}"  autocomplete="off" class="layui-input" min="0" max="10">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit="" lay-filter="" >提交</button>
            </div>
        </div>
    </form>
</rapid:override>

<rapid:override name="frame-footer-script">
    <script>
        layui.use(['form','laydate'], function() {
            var form = layui.form
                , layer = layui.layer
                , laydate = layui.laydate;

            //自定义验证规则
            form.verify({
                title: function (value) {
                    if (value.length < 5) {
                        return '标题至少得5个字符啊';
                    }
                }
            });

            KindEditor.ready(function(K) {
                var editor1 = K.create('textarea[id="content"]', {
                    //cssPath:'resources/kindeditor/themes/qq/qq.css',
                    uploadJson : 'article/uploadImg', //用来上传文件 改成我们服务端的地址
                    allowFileManager : true,
                    width:'1100px',
                    height:'400px'
                });
                prettyPrint();
            });

            layui.use('code', function(){ //加载code模块
                layui.code();
            });
        });
    </script>
</rapid:override>

<%@include file="../framework.jsp"%>